import request from '../utils/request';

export const fetchData = query => {
    return request({
        url: './table.json',
        method: 'get',
        params: query
    });
};

export const login = query => {
    return request({
        url:"/api/login",
        method: 'post',
        data: query
    })
}


export const getCityData = query => {
    return request({
        url:"./city.json",
        method:'get',
        params: query
    })
}


export const makeWeatherMap = query => {
    return request({
        url:"https://cdn.jsdelivr.net/gh/apache/echarts-website@asf-site/examples/data/asset/data/wind-barb-hobart.json",
        method: 'get',
        params: query
    })
}


export const getWeatherData = query => {
    return request({
        url:'/api/getCityWeather',
        method:'post',
        data:query
    })
}


export const getUserInfo = query => {
    return request({
        url:'/api/getUserInfo',
        method:'post',
        data:query
    })
}


export const upDateUserInfo = query => {
    return request({
        url:'/api/updateUserInfo',
        method:'post',
        data:query
    })
}


export const subscribeWeather = query => {
    return request({
        url:'/api/subscribeWeather',
        method:'post',
        params: query
    })
}